﻿@model Blog

@{
    ViewBag.Title = "Redigér Blog";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-calendar"></span> @ViewBag.Title</h1>
</div>
    
@if (!ViewData.ModelState.IsValid)
{
    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        @Html.ValidationSummary("", new { @style = "color: #fff;" })
    </div>
}

@using (Html.BeginForm("Edit", "Blog", FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()

    @Html.HiddenFor(b => b.Id)
    @Html.HiddenFor(b => b.OldId)
    @Html.HiddenFor(b => b.AuthorId)
    
    @Html.EditorFor(b => b.Title)
    @Html.EditorFor(b => b.Content)

    <div class="form-group">
        <label for="create" class="col-sm-1 col-lg-1 control-label"></label>
        <div class="col-sm-11">
            <button type="submit" class="btn btn-default">Gem</button>
        </div>
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/globalize")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/Scripts/_thecup_editing.js")
}
